Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Pairing the PR2 with a New PS3 Joystick
Description: Instructions for pairing the PR2 to a new PS3 joystick.Keywords: teleop ps3
Tutorial Level: ADVANCED
Contents
Find the PR2's Bluetooth MAC Address
The first step is to find the PR2's bluetooth MAC address. The key step here is that it is c2 that has bluetooth:
ssh c2 hciconfig
You should see output something like:
$ hciconfig hci0: Type: USB BD Address: 00:1B:DC:00:06:F8 ACL MTU: 310:10 SCO MTU: 64:8 UP RUNNING PSCAN RX bytes:647476598 acl:11163343 sco:0 events:560 errors:0 TX bytes:5862 acl:262 sco:0 commands:137 errors:0
The MAC address is listed after BD Address. In this example it is 00:1B:DC:00:06:F8.
If this doesn't work, you can try:
sudo hciconfig hci0 up hciconfig
If that still does not work, doublecheck that you are running on c2 not c1.
Set the Joystick's Bluetooth Master
Using the microUSB cable, plug the joystick into any computer running ROS for which you have sudo. Set the joystick's Bluetooth master to the PR2's MAC address using:
roscd ps3joy sudo ./bin/sixpair <MAC Address>
You should see output like:
Current Bluetooth master: 00:02:76:2a:20:71 Setting master bd_addr to 00:1b:dc:00:06:f8
Pair the Joystick and PR2
Unplug the joystick from the computer. The PR2 automatically runs ps3joy.py so you should not have to start that. Instead simply start the robot:
robot start
And then launch pr2_teleop
roslaunch pr2_teleop telop_joystick.launch
Press the center button of the joystick to pair it with the PR2. You should now be able to control the PR2 using the new joystick.
More Information
For more information, see the ps3joy package. Pairing a new PS3 joystick with the PR2 is similar to pairing the joystick to a computer with one USB.
When following any tutorials about bluetooth on the PR2, remember:
- Bluetooth is on c2 not c1
- The PR2 starts ps3joy.py when it boots. If you try the command
rosrun ps3joy ps3joy.py
you will see an error about the process already running. There was apparently a problem with Karmic that would also give this error, but make sure you have killed any previous ps3joy process before trying those fixes:ps -A|grep ps3joy